package logging

import (
	"fmt"

	"github.com/op/go-logging"
)

func SetOpLogging(l *logging.Logger) {
	defaultLogging = &LoggerOP{
		Logger: l,
	}
}

type LoggerOP struct {
	*logging.Logger
}

func (lop *LoggerOP) Debugln(v ...interface{}) {
	lop.Logger.Debug(fmt.Sprintln(v))
}
func (lop *LoggerOP) Errorln(v ...interface{}) {
	lop.Logger.Error(fmt.Sprintln(v))
}

func (lop *LoggerOP) Fatalln(v ...interface{}) {
	lop.Logger.Fatal(fmt.Sprintln(v))
}
func (lop *LoggerOP) Infoln(v ...interface{}) {
	lop.Logger.Info(fmt.Sprintln(v))
}

// func (lop *LoggerOP) Infoln(v ...interface{}) {
// 	lop.Logger.Info(fmt.Sprintln(v))
// }

func (lop *LoggerOP) Warningln(v ...interface{}) {
	lop.Logger.Warning(fmt.Sprintln(v))
}

func (lop *LoggerOP) Print(v ...interface{}) {
	lop.Logger.Info(fmt.Sprintln(v))
}
func (lop *LoggerOP) Printf(f string, v ...interface{}) {
	lop.Logger.Infof(f, v)
}
func (lop *LoggerOP) Println(v ...interface{}) {
	lop.Logger.Info(fmt.Sprintln(v))
}
